package com.example.app1;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;

public class MyService extends Service {
    public MyService() {
    }

    //获取AIDL的Binder
    private final Binder mBinder = new IMyAidlInterface.Stub(){

        @Override
        public double plus(double a, double b) throws RemoteException {
            return a + b;

        }

        @Override
        public double minus(double a, double b) throws RemoteException {
            return a - b;
        }

        @Override
        public double multiply(double a, double b) throws RemoteException {
            return a * b;
        }
    };

    @Override
    public IBinder onBind(Intent intent) {
        return mBinder;
    }
}